#include<stdio.h>
void main()
{
	char a,b,c;
	scanf("%c,%c,%c",&a,&b,&c);


			printf("%c\n",c);
			printf("%c\n",b);
			printf("%c\n",a);


			printf("%d\n",c);
			printf("%d\n",b);
			printf("%d\n",a);
}